<template>
  <div class="receive_record">
    <el-table :data="tableData" border>
      <el-table-column label="领取用户" prop="nickname" align="center"></el-table-column>
      <el-table-column label="联系方式" prop="mobilePhone" align="center"></el-table-column>
      <el-table-column label="领取时间" prop="receiveTime" align="center"></el-table-column>
      <el-table-column label="使用状态" align="center">
        <template slot-scope="scope">
          {{scope.row.status | statusFilter}}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    props: ['id'],
    filters: {
      statusFilter(status) {
        switch(status) {
          case -1:
            return '过期';
          case 0:
            return '未用';
          case 1:
            return '已用';
          case 2:
            return '待激活'
        }
      }
    },
    data() {
      return {
        searchForm: {
          currentPage: 1,
          pageSize: 10,
        },
        tableData: []
      }
    },
    mounted() {
      this.searchForm.ticketId = this.id;
      this.getParkTicketInfo();
    },
    methods: {
      getParkTicketInfo() {
        this.$axios({
          method: 'get',
          url: '/system/cust-ticket/get-park-ticket-info',
          params: this.searchForm
        }).then((res) => {
          if(res.code == 200) {
            this.tableData = res.data.records;
          }
        })
      }
    }
  }
</script>

<style scoped>





</style>
